//
//  ViewController.m
//  碎片切换器封装
//
//  Created by 黄星 on 15/4/28.
//  Copyright (c) 2015年 qingfanqie. All rights reserved.
//

#import "ViewController.h"
#import "SegBtnView.h"


@interface ViewController ()

@end

@implementation ViewController

- (void)viewDidLoad {
    [super viewDidLoad];
    // Do any additional setup after loading the view, typically from a nib.
    
    [self initView];
}

- (void)initView
{
    SegBtnView *v = [[SegBtnView alloc] initWithFrame:CGRectMake(0, 20, CGRectGetWidth([[UIScreen mainScreen] bounds]), 40)];

    [v setSegBtnViewWithBtnName:@[@"主题",@"已申请",@"全部"] AndBtnIndex:^(NSInteger btnIndex) {
        NSLog(@"%@",@(btnIndex));
    }];
    
    UIView *v2 = [[UIView alloc] initWithFrame:self.view.frame];
    v2.backgroundColor = [UIColor lightGrayColor];
    
    [self.view addSubview:v2];
    
    [self.view addSubview:v];
}

- (void)touchesBegan:(NSSet *)touches withEvent:(UIEvent *)event
{
    NSLog(@"1");
}
- (void)touchesMoved:(NSSet *)touches withEvent:(UIEvent *)event
{
    NSLog(@"2");
}
- (void)touchesEnded:(NSSet *)touches withEvent:(UIEvent *)event
{
    NSLog(@"3");
}

- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}

@end
